Skip to content

[NFC] Allow SubTypes::iterSubTypes to stop early#8573

Open
kripken wants to merge 5 commits intoWebAssembly:mainfrom
kripken:subtypes.failfast
Open

[NFC] Allow SubTypes::iterSubTypes to stop early#8573
kripken wants to merge 5 commits intoWebAssembly:mainfrom
kripken:subtypes.failfast

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Apr 3, 2026

In ConstantFieldPropagation this is important: we scan subtypes
to check if they all have 2 possible values we can ref.test between.
In the common case there are many values and we can stop early.

This makes the pass 4.2x faster on a large Dart testcase, and
-O3 overall 3.5% faster.

Fun fact, the test that is added to here was slightly wrong before:
lacking a rec group, types B and C were actually identical, so we
didn't fully test what we thought we did.

@kripken kripken requested a review from a team as a code owner April 3, 2026 23:52
@kripken kripken requested review from stevenfontanella and removed request for a team April 3, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant